package cn.jinzhu.springcloud;

import cn.jinzhu.springcloud1.MyselRefult;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
@EnableEurekaClient
@SpringBootApplication
//ribbnt的替换   MyselRefult.class 轮询 重试 随机 等 自定义ribbon负载均衡  ，默认是轮询提供者多个端口
@RibbonClient(name = "CLOUD-PAYMENT-PROVIDER",configuration = MyselRefult.class)
public class CloudConsumerOrder80 {
    public static void main(String[] args) {
        SpringApplication.run(CloudConsumerOrder80.class, args);
    }

    @Bean
    @LoadBalanced
    RestTemplate restTemplate(){
        return  new RestTemplate();
    }
}
